package com.cloudcreativity.blyg.sqlite;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.cloudcreativity.blyg.sqlite.CategoryTwo;
import com.cloudcreativity.blyg.sqlite.Goods;
import com.cloudcreativity.blyg.sqlite.Provider;
import com.cloudcreativity.blyg.sqlite.Province;
import com.cloudcreativity.blyg.sqlite.Area;
import com.cloudcreativity.blyg.sqlite.City;
import com.cloudcreativity.blyg.sqlite.CategoryOne;

import com.cloudcreativity.blyg.sqlite.CategoryTwoDao;
import com.cloudcreativity.blyg.sqlite.GoodsDao;
import com.cloudcreativity.blyg.sqlite.ProviderDao;
import com.cloudcreativity.blyg.sqlite.ProvinceDao;
import com.cloudcreativity.blyg.sqlite.AreaDao;
import com.cloudcreativity.blyg.sqlite.CityDao;
import com.cloudcreativity.blyg.sqlite.CategoryOneDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig categoryTwoDaoConfig;
    private final DaoConfig goodsDaoConfig;
    private final DaoConfig providerDaoConfig;
    private final DaoConfig provinceDaoConfig;
    private final DaoConfig areaDaoConfig;
    private final DaoConfig cityDaoConfig;
    private final DaoConfig categoryOneDaoConfig;

    private final CategoryTwoDao categoryTwoDao;
    private final GoodsDao goodsDao;
    private final ProviderDao providerDao;
    private final ProvinceDao provinceDao;
    private final AreaDao areaDao;
    private final CityDao cityDao;
    private final CategoryOneDao categoryOneDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        categoryTwoDaoConfig = daoConfigMap.get(CategoryTwoDao.class).clone();
        categoryTwoDaoConfig.initIdentityScope(type);

        goodsDaoConfig = daoConfigMap.get(GoodsDao.class).clone();
        goodsDaoConfig.initIdentityScope(type);

        providerDaoConfig = daoConfigMap.get(ProviderDao.class).clone();
        providerDaoConfig.initIdentityScope(type);

        provinceDaoConfig = daoConfigMap.get(ProvinceDao.class).clone();
        provinceDaoConfig.initIdentityScope(type);

        areaDaoConfig = daoConfigMap.get(AreaDao.class).clone();
        areaDaoConfig.initIdentityScope(type);

        cityDaoConfig = daoConfigMap.get(CityDao.class).clone();
        cityDaoConfig.initIdentityScope(type);

        categoryOneDaoConfig = daoConfigMap.get(CategoryOneDao.class).clone();
        categoryOneDaoConfig.initIdentityScope(type);

        categoryTwoDao = new CategoryTwoDao(categoryTwoDaoConfig, this);
        goodsDao = new GoodsDao(goodsDaoConfig, this);
        providerDao = new ProviderDao(providerDaoConfig, this);
        provinceDao = new ProvinceDao(provinceDaoConfig, this);
        areaDao = new AreaDao(areaDaoConfig, this);
        cityDao = new CityDao(cityDaoConfig, this);
        categoryOneDao = new CategoryOneDao(categoryOneDaoConfig, this);

        registerDao(CategoryTwo.class, categoryTwoDao);
        registerDao(Goods.class, goodsDao);
        registerDao(Provider.class, providerDao);
        registerDao(Province.class, provinceDao);
        registerDao(Area.class, areaDao);
        registerDao(City.class, cityDao);
        registerDao(CategoryOne.class, categoryOneDao);
    }
    
    public void clear() {
        categoryTwoDaoConfig.clearIdentityScope();
        goodsDaoConfig.clearIdentityScope();
        providerDaoConfig.clearIdentityScope();
        provinceDaoConfig.clearIdentityScope();
        areaDaoConfig.clearIdentityScope();
        cityDaoConfig.clearIdentityScope();
        categoryOneDaoConfig.clearIdentityScope();
    }

    public CategoryTwoDao getCategoryTwoDao() {
        return categoryTwoDao;
    }

    public GoodsDao getGoodsDao() {
        return goodsDao;
    }

    public ProviderDao getProviderDao() {
        return providerDao;
    }

    public ProvinceDao getProvinceDao() {
        return provinceDao;
    }

    public AreaDao getAreaDao() {
        return areaDao;
    }

    public CityDao getCityDao() {
        return cityDao;
    }

    public CategoryOneDao getCategoryOneDao() {
        return categoryOneDao;
    }

}
